﻿#region References
using System;
using System.Windows.Forms;
#endregion

namespace Autumoon.LiveWriterPlugin.Demo
{
    /// <summary>
    /// The process form which is used to show to user.
    /// </summary>
    public partial class ProcessForm : Form
    {
        #region Fields and Properties
        #endregion

        #region Constructors
        /// <summary>
        /// Default constructor.
        /// </summary>
        public ProcessForm()
        {
            InitializeComponent();
        }
        #endregion

        #region Public Methods
        #endregion

        #region Internal Methods
        #endregion

        #region Protected Methods
        /// <summary>
        /// End the process.
        /// </summary>
        private void EndProcess()
        {
            this.Close();
        }
        #endregion

        #region Delegates and Events
        private void contentTextBox_TextChanged(object sender, EventArgs e)
        {
            this.insertButton.Enabled = !String.IsNullOrEmpty(((TextBox)sender).Text);
        }

        private void insertButton_Click(object sender, EventArgs e)
        {
            ContentProcessor.Process(this.contentTextBox.Text);

            this.EndProcess();
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            this.EndProcess();
        }
        #endregion

        #region Private Methods
        #endregion
    }
}
